package com.hns.can.mainte.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hns.can.common.aop.orgTree.LeftOrgAnnotation;
import com.hns.can.common.service.BaseInfoValueService;
import com.hns.can.common.vo.CommonParamsVo;
import com.hns.can.mainte.entity.CommCapacityStatInfoEntity;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.tool.pub.PubUtil;

/**
 * 电容状态Service
 * @author:zhangzq
 * @email:
 * @version Revision 2.0.0
 */
@Service
public class CapacitorStatusService extends CommonService{
	
    @Autowired
    private BaseInfoValueService baseInfoValueService;
    
	/**
	 * 分页查询电容状态
	 * @param params
	 * @return
	 * @throws Exception
	 * @author:zhangzq
	 * @email:
	 */
	@LeftOrgAnnotation()
    @Transactional
//    @DriverInterfaceAnnotation()
	public Pagination searchCapacitorStatus(CommonParamsVo params) throws Exception {
		Pagination page = this.myBatisPage("capacitorStatus.searchCapacitorStatusCount", "capacitorStatus.searchCapacitorStatusInfo", params, CommCapacityStatInfoEntity.class);
		List list = page.getData();
		baseInfoValueService.fillOrganLineLicPltNo(list);
		page.setData(list);
		return page;
	}
	
	/**
	 * 查询电容状态
	 * @param params
	 * @return
	 * @throws Exception
	 * @author:zhangzq
	 * @email:
	 */
	@SuppressWarnings("unchecked")
	@LeftOrgAnnotation()
    @Transactional
//    @DriverInterfaceAnnotation()
	public List<CommCapacityStatInfoEntity> getCapacitorStatusData(CommonParamsVo params) throws Exception {
		List<CommCapacityStatInfoEntity> list = PubUtil.convertListMapToObject(this.sqlMapDao.selectList("capacitorStatus.searchCapacitorStatusInfo", params), CommCapacityStatInfoEntity.class);
		baseInfoValueService.fillOrganLineLicPltNo(list);
		return list;
	}

}
